package com.mall.product.controller;

import com.mall.entity.TbGoodsCarousel;
import com.mall.product.service.GoodsCarouselService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: W
 * @date: 2021/07/27/10:56
 * Other: 商品轮播图
 */
@RestController
@RequestMapping("/carousel")
@CrossOrigin
public class GoodsCarouselController {

    @Autowired
    private GoodsCarouselService goodsCarouselService;

    @GetMapping("/findByGoodsId")
    public List<TbGoodsCarousel> findByGoodsId(Long goodsId) {
        return goodsCarouselService.findByGoodsId(goodsId);
    }


}
